#ifndef SWKNXDEVICE_H
#define SWKNXDEVICE_H
#include "System/System.h"
#include "Device/BaseDevice.h"
#include "Protocol/SWKNXProtocol.h"

#include "Command/SWKNXProtocol/CtrlSWKNXProgramLed.h"
#include "Command/SWKNXProtocol/getKNXMacCmd.h"
#include "Command/SWKNXProtocol/ackKNXMacCmd.h"
#include "Command/SWKNXProtocol/getKNXStatusCmd.h"
#include "Command/SWKNXProtocol/ackKNXStatusCmd.h"
#include "Command/CloudProtocol/UpperSearchResponseCmd.h"
#include "Command/SWKNXProtocol/readKNXCtrlCmd.h"
#include "Command/SWKNXProtocol/writeKNXCtrlCmd.h"
#include "Function/ControlKNXFunc.h"
#include "Function/ControlPointFunc.h"
#include "File/Xml/SWKNXListXml.h"
class SWKNXDevice : public BaseInterface<SWKNXDevice>
{
    Q_OBJECT
public:
    Q_INVOKABLE explicit SWKNXDevice(QObject *parent = 0);

    void ackKNXMacCmdHandle(PortStruct source, QSharedPointer<BaseCmd> sharedCmd);
    void ackKNXStatusCmdHandle(PortStruct source, QSharedPointer<BaseCmd> sharedCmd);
    void readKNXCtrlCmdHandle(PortStruct source, QSharedPointer<BaseCmd> sharedCmd);


    void controlKNXFuncHandle(QSharedPointer<BaseFunc> sharedFunc);
    void restartTimer();

private:
    SWKNXProtocol *swKNXProtocol;
    PortStruct m_target;
    QTimer *getStatusTimer;
    QTimer *getMacTimer;
    quint8 ss;
    QTimer *DelaySendTimer;
    QList<SWKNXDataStruct> DelaySendList;

private slots:
    void DelaySendSlot();




public slots:

    void heartbeatSlot();
    void getMacSlot();
    void getStatusSlot();
     void writeC3();
     void writeFB(quint16 address,quint8 len,QByteArray dataList);




};

#endif // SWKNXDEVICE_H
